package com.example.javaproject;

import java.util.concurrent.Callable;

/**
 * Created by zjx8969 on 2018/3/21.
 */

public class ComputeCall<Integer> implements Callable<java.lang.Integer> {
    int x, y;

    public ComputeCall(int x, int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public java.lang.Integer call() throws Exception {
        Thread.sleep(200);
        System.out.println(Thread.currentThread().getId() + " x=" + x + " y=" + y);
        return x + y;
    }
}
